<template>
  <normal-layout page-index="2-1">
    <el-tabs style="margin: 10px">
      <el-tab-pane label="订单列表">
        <order-table :order-data="orderList" @delivered="getOrderList"></order-table>
      </el-tab-pane>
      <el-tab-pane label="预定列表">
        <subscribe-table :sub-data="subList"></subscribe-table>
      </el-tab-pane>
    </el-tabs>
  </normal-layout>
</template>

<script>
    import NormalLayout from "../../layouts/NormalLayout";
    import OrderTable from "../../components/Management/OrderTable";
    import SubscribeTable from "../../components/Management/SubscribeTable";
    export default {
        name: "index",
      components: {SubscribeTable, OrderTable, NormalLayout},
      data(){
         return{
           orderList:[],
           subList:[],
         }
      },
      mounted() {
        this.getData()
      },
      methods:{
        getData(){
          this.getSubList();
          this.getOrderList();
        },
        async getSubList(){
          this.$axios.get("/get_sub_table").then((res)=>{
            this.subList=res.data;
            console.log(res.data)
          })
        },
        async getOrderList(){
          this.$axios.get("/get_border_table").then((res)=>{
            this.orderList=res.data;
            console.log(res.data)
          })
        },
      }
    }
</script>

<style scoped>

</style>
